package com.chief.openfeign.web.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class TestClsFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("TestClsFilter init");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
        System.out.println("TestClsFilter doFilter " + httpServletRequest.getServletPath());
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        System.out.println("TestClsFilter destroy");
    }
}
